<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
 %>
<html>
	<head>
		<title>用户登陆</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">

		<link rel="stylesheet" type="text/css"
			href="<%=path %>/themes/css/ext-all.css" />
		<link rel="stylesheet" type="text/css" href="<%=path %>/themes/css/common.css" />

		<script type="text/javascript" src="<%=path %>/script/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=path %>/script/ext/ext-all.js"></script>

		<script type="text/javascript">
			Ext.onReady(function(){ 
		 		Ext.get("logon").on("click", function(){
		 			if(Ext.getDom("userName").value==""){
						Ext.MessageBox.alert('提示', '请输入用户名！',function(){
							Ext.get("userName").focus();
						}); 
						return;
					}
					if(Ext.getDom("passWord").value==""){
						Ext.MessageBox.alert('提示', '请输入密码！',function(){
							Ext.get("passWord").focus();
						});
						return;
					}
					
					var msg = Ext.get('msg');
					msg.load({
						url: '<%=path%>/logon.do',
						params: 'userName='+Ext.getDom("userName").value+'&passWord='+Ext.getDom("passWord").value,
						text: 'Logoning...',
						callback: function(oElement) {
							if(oElement.dom.innerHTML=="success"){
								oElement.dom.innerHTML="<font color='green'>验证成功，,请稍候...</font>";
								window.setTimeout("window.location='pages/admin/index.jsp'", 200);
							}
	                    }
					});
					msg.show();
			    });
			    
			    Ext.get("close").on("click",function(){ 
			    	Ext.MessageBox.confirm('提示', '你确定要退出系统么?', function(button){
			    		if(button=='yes'){
			    			window.close();
			    		}
			    	});
			    });
			    
			});
 		</script>

	</head>
	<body class="logon-body">
		<table class="logon-body-table">
			<tr class="logon-body-table-tr">
				<td class="logon-body-table-tr-td">
					<div class="logon-body-table-tr-td-div">
						<div class="logon-body-table-tr-td-div-div">
							用户名&nbsp;:&nbsp;
							<input type="text" id="userName" name="userName" size="20" />
						</div>
						<div class="logon-body-table-tr-td-div-div">
							密&nbsp;&nbsp;&nbsp;&nbsp;码&nbsp;:&nbsp;
							<input type="password" id="passWord" name="passWord" size="20" />
						</div>
						<div align="right" class="logon-body-table-tr-td-div-div">
							<button id="logon">
								登陆
							</button>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<button id="close">
								关闭
							</button>
							&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
						<div id="msg" align="right" class="logon-body-table-tr-td-div-message">
						</div>
					</div>
				</td>
			</tr>
		</table>
	</body>
</html>
